<template>
	<view class="banner-components" :style="[wrapStyle,componentsStyle]" v-if="moduleData.length">
		<u-swiper :list="moduleData" :name="name" :height="height" :border-radius="borderRadius" img-mode="scaleToFill" bg-color="transparent" @click="handleClick"></u-swiper>
	</view>
</template>

<script>
import mixins from '@/mixins/components.js';
export default {
	name: 'banner-module',
	mixins: [mixins],
	props: {
		// 轮播图高度
		height: {
			type: [String,Number],
			default: 250
		},
		borderRadius: {
			type: [String,Number],
			default: 8
		},
		// 图片键名
		name: {
			type: String,
			default: 'imgUrl'
		},
		zIndex: {
			type: [String, Number],
			default: 99
		}
	},
	computed: {
		componentsStyle() {
			let style = {};
			style.zIndex = this.zIndex;
			return style;
		}
	},
	methods: {
		// 点击轮播图
		handleClick(index) {
			this.$emit('click',this.moduleData[index])
		}
	},
	
};
</script>

<style scoped lang="scss">
.banner-components {
}
</style>
